<?php
namespace Admin\Controller;
use Think\Controller;
class MovieController extends CommonController
{
    var $movie;
    
    function __construct()
    {
        parent::__construct();
        $this->movie = M('movie');

    }
    function add(){
        $this->type = M('type');
        $this->region = M('region');
        $this->style = M('style');
        $types = $this->type->select();
        //dump($types);exit;
        $this->assign("types",$types);
        $regiones = $this->region->select();
        //dump($regiones);exit;
        $this->assign("regiones",$regiones);
        $styles = $this->style->select();
        //dump($styles);exit;
        $this->assign("styles",$styles);
        $this->display();
    }
    function store(){
        //dump($_POST);exit;
        $this->movie->create();

        $this->movie->date=strtotime(I("post.date"));
        $this->movie->add();
        $this->redirect('add');
    }
}